home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / popupre / mdichild.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-03-03  |  3.0 KB  |  97 lines

  1. VERSION 2.00
  2. Begin Form frmMDIChild 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "MDI Child"
  6.    ClientHeight    =   975
  7.    ClientLeft      =   3360
  8.    ClientTop       =   4935
  9.    ClientWidth     =   3330
  10.    Height          =   1380
  11.    Left            =   3300
  12.    MaxButton       =   0   'False
  13.    MDIChild        =   -1  'True
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   975
  16.    ScaleWidth      =   3330
  17.    Top             =   4590
  18.    Width           =   3450
  19.    Begin CommandButton cmdClose 
  20.       Cancel          =   -1  'True
  21.       Caption         =   "Close"
  22.       Default         =   -1  'True
  23.       Height          =   345
  24.       Left            =   1335
  25.       TabIndex        =   0
  26.       Top             =   315
  27.       Width           =   1485
  28.    End
  29.    Begin Image imgButtonUp 
  30.       Height          =   330
  31.       Left            =   2865
  32.       Picture         =   MDICHILD.FRX:0000
  33.       Top             =   15
  34.       Visible         =   0   'False
  35.       Width           =   360
  36.    End
  37.    Begin Image imgButtonDown 
  38.       Height          =   330
  39.       Left            =   2865
  40.       Picture         =   MDICHILD.FRX:0182
  41.       Top             =   345
  42.       Visible         =   0   'False
  43.       Width           =   360
  44.    End
  45.    Begin Image imgPopUp 
  46.       Height          =   330
  47.       Left            =   450
  48.       Top             =   345
  49.       Width           =   360
  50.    End
  51.    Begin Label lblMenuClick 
  52.       BackColor       =   &H000000FF&
  53.       ForeColor       =   &H000000FF&
  54.       Height          =   225
  55.       Left            =   2910
  56.       TabIndex        =   1
  57.       Top             =   735
  58.       Visible         =   0   'False
  59.       Width           =   285
  60.    End
  61. Option Explicit
  62. Sub cmdClose_Click ()
  63.     ' Unload the form when 'Close' is pressed
  64.     Unload Me
  65. End Sub
  66. Sub Form_Load ()
  67.     ' Show 'button up' image initially
  68.     imgPopUp = imgButtonUp
  69. End Sub
  70. Sub HandleMyPopUp (P_nIndex As Integer)
  71. ' This sub would handle the clicks on the menu entries of the
  72. ' child popup menu received by lblMenuClick from frmMenuContainer
  73.     Select Case P_nIndex
  74.     Case 0:
  75.     Case 1:
  76.     Case 2:
  77.     Case 3:
  78.     End Select
  79. End Sub
  80. Sub imgPopUp_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  81.     ' Show 'button down' image
  82.     imgPopUp = imgButtonDown
  83.     ' Pop up the child menu defined in frmMenuContainer
  84.     PopupMenu frmMenuContainer.mnuPopUpChild, 0
  85.     ' Show 'button up' image
  86.     imgPopUp = imgButtonUp
  87. End Sub
  88. Sub lblMenuClick_Change ()
  89. ' The 'Change' event of this label is triggered when a click on
  90. ' a menu entry in frmMenuContainer sets the label caption with the
  91. ' related menu entry index
  92.     ' Handle the menu click if an index is available
  93.     If lblMenuClick <> "" Then HandleMyPopUp Val(lblMenuClick)
  94.     ' Reset the label for new menu entry clicks
  95.     lblMenuClick = ""
  96. End Sub
  97.